<template>
  <div>
    <van-collapse v-model="activeNames" class="ques-list">
      <van-collapse-item v-for="(item,index) in list" :key="item.unid" :name="index">
        <template #title>
          <img class="imgtit" src="@/assets/ques.png" alt="">
          <span>{{ item.title }}</span>
        </template>
        <div class="content">{{ item.content }}</div>
      </van-collapse-item>
    </van-collapse>
  </div>
</template>

<script>
import {getList} from "@/api/eraqQuestions"

export default {
  name: "question",
  data() {
    return {
      activeNames: [],
      list: []
    }
  },
  mounted() {
    getList().then((res) => {
      if (res.msg !== "") {
        this.list = [];
        return;
      }
      this.list = res.data;
    }).catch(() => {
      console.log("接口调用异常");
      this.list = []
    });
  }
}
</script>

<style lang='scss' scoped>
@import "src/css/home";
</style>
